const {
  listByLoginUser,
} = require('../../apiConfig/apiList/luban')
Page({

  /**
   * 页面的初始数据
   */
  data: {
    value: '',
    showFIlter: false,
    ordrList: [
      {},{}
    ],
    dateStart: '2016-09-01',
    schoolChecked: '',
    showSchool: false,
    schoolList: [
      {
        name: '选项1',
        value: '1',
      },
      {
        name: '选项232',
        value: '2',
      },
    ],
    typeChecked: '',
    showtype: false,
    typeList: [
      {
        name: '教学区',
        value: '1',
      },
      {
        name: '生活区',
        value: '2',
      },
    ],
    statusChecked: '',
    showStatus: false,
    statusList: [
      {
        name: '待结算',
        value: '1',
      },
      {
        name: '已完成',
        value: '2',
      },
    ],
  },
  bindDateStart: function (e) {
    console.log('picker发送选择改变，携带值为', e.detail.value)
    this.setData({
      dateStart: e.detail.value
    })
  },
  showSchoolEevent: function(){
    this.setData({ showSchool: true });
    console.log('showSchoolEevent', this.data.showSchool)
  },
  showTypeEevent: function(){
    this.setData({ showType: true });
    console.log('showSchoolEevent', this.data.showType)
  },
  schoolCSelect(e) {
    console.log('onSelect', e.detail);
    this.setData({
      schoolChecked: e.detail.name
    })
    this.setData({ showSchool: false });
  },
  typeSelect(e) {
    console.log('onSelect', e.detail);
    this.setData({
      typeChecked: e.detail.name
    })
    this.setData({ showType: false });
  },
  schoolClose() {
    this.setData({ showSchool: false });
  },
  showStatusEevent: function(){
    this.setData({ showStatus: true });
    console.log('showSchoolEevent', this.data.showSchool)
  },
  statusSelect(e) {
    console.log('onSelect', e.detail);
    this.setData({
      statusChecked: e.detail.name
    })
    this.setData({ showStatus: false });
  },
  statusClose() {
    this.setData({ showStatus: false });
  },
  filterList(e) {
    this.setData({
      showFIlter: !this.data.showFIlter
    })
  },
  onConfirm(e) {
    console.log('搜索', e);
    this.setData({
      value: e.detail,
    });
  },
  onChange(e) {
    console.log('搜索', e);
    this.setData({
      value: e.detail,
    });
  },
  onSearch() {
    console.log('搜索' + this.data.value);
  },
  onClick() {
    console.log('搜索' + this.data.value);
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})